//夜间模式与日间模式的切换
//方式一
/*const  btn =document.getElementById('modeBtn');
btn.addEventListener('click',(e)=>{
    const body =document.body;
    if(e.target.innerHTML==='sun'){
        body.style.backgroundColor='black';
        body.style.color='white';
        e.target.innerHTML='night';
    }else {
        body.style.backgroundColor='white';
        body.style.color='black';
        e.target.innerHTML='sun';
    }
});
*/


//方式二
const btn =document.getElementById('modeBtn')
btn.addEventListener('click',(e)=>{
    const body =document.body;
    if(body.className !== 'night')body.className='night';
    else body.className='';
})



